#ifndef WJSRUNTIME_H
#define WJSRUNTIME_H
#include "quickjs.h"
#include <iostream>
#include <string>
#include "quickjs-libc.h"
using std::string;
using std::cout;
using std::endl;


struct WJsRuntime
{
    public:
        WJsRuntime();
        virtual ~WJsRuntime();
        // memlimitMB = 0 use default memlimit.
        bool init(size_t memlimitMB,string& error) ;

        inline JSRuntime* getRuntime() { return _runtime; }
        inline JSContext* getContext() { return _ctx; }
        void dump_error();

    protected:
        JSRuntime* _runtime ;
        JSContext* _ctx ;

    private:
};

#endif // WJSRUNTIME_H
